package com.uni.common.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.uni.common.util.SystemConfig;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;


@NoArgsConstructor
@Data
public class Company {
    private static final long serialVersionUID = 1L;

    private Long id;
    /**
     * 公司名
     */
    private String name ;
    /*
     * 描述
     * */
    private String desc;
    /*
     * 负责人
     * */
    private String manageNickname;

    private String managePhone;

    private String detailAddress;

    private String provinceId;

    private String  cityId;

    private String countyId;

    private String  province;

    private String city;

    private String county;

    private String coverImg;

    /**
     * 是否删除
     */
    private Integer deleted;

    @JsonFormat(timezone = "GMT+8", pattern = "YYYY-MM-dd HH:mm:ss")
    private Date updateTime;
    /**
     * 发布时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "YYYY-MM-dd HH:mm:ss")
    private Date createTime;

    public String getCoverImgAll() {
        if(coverImg != null && !"".equals(coverImg) && !coverImg.startsWith("http")) {
            return SystemConfig.basePath + coverImg;
        }
        return coverImg;
    }
}
